<!DOCTYPE html>
<html>
<head>
	{include file="Public/header"}
	<style>
	    .row{margin:0;padding: 0}
		.hcg .on{
			color:black;
			font-weight:bold;
		}
		.unstyled{
			padding-left:0;
		}
		.unstyled li{
			padding-top:2px;
			padding-bottom:2px;
		}
		.ibox-title{
			background-color: #d3e0e6;
		}
	</style>
</head>
<body style="background-color: rgb(240, 243, 244);">
	<div class="row text-center">
		{if $type_id==0}
		<!--<iframe src="{:url('TiApply2/view')}?id={$yw_id}" height="700px" width="90%" ></iframe>-->
		<!--{else}
		<iframe src="{:url('TiApply/apply_de')}?aid={$yw_id}" height="700px" width="90%" ></iframe>-->
		{/if}
		<div style="text-align: center;margin: 10px;">
			{if $status==2}
			<form action="" id="f1">
			<input type="hidden" name="aid" value='{$yw_id}'>
			 <input type="hidden" id="nodeKey" name="nodeKey"/>
                  <input type="hidden" id="selectId" name="selectId"/>
                  <input type="hidden" id="selectName" name="selectName"/>
                    {volist name="btn.nextNodes" id="b"}
                      {if $b.nodeName=='结束'}
                      <input type="button" class="btn-danger btn" onclick="zuofei('{$b.nodeKey}','{$b.selectId}','{$b.selectName}')" value="点此作废"/>

                      {/if}
                    {/volist}
               </form>
			{else}
			<button class="btn btn-primary" type="button" id="tijiao">进入下一步</button>
			{/if}
		</div>
	</div>
</body>
{include file="Public/footer"}
<script src="__STATIC__/layout/js/contabs_sub.js"></script>
<script>
	     //提交工作流
    $('#tijiao').click(function () {
      location.href='{:url("Workflowdb/gzlsp",["workId"=>request()->param("workId"),"trackId"=>request()->param("trackId")])}'
      return false
               
    })
</script>
<script type="text/javascript">
var fr={$from};
var type_id={$type_id};
      function zuofei(nodeKey,selectId,selectName){
  $("#nodeKey").val(nodeKey)
  $("#selectId").val(selectId)
  $("#selectName").val(selectName)
   $.ajax({
          cache: true,
          type: "POST",
          url:"{:url('ydzuofeichuli')}",
          data:$('#f1').serialize(),// 你的formid
          async: false,
          error: function(request) {
            alert("Connection error");
          },
          success: function(data) {
           // alert(data);
            //var res=JSON.parse(data);
                    var res1=JSON.parse(data);
                            if(res1["state"]==1){
                              swal({
                                title: "完成",
                                text: "操作已成功",
                                type: "success"
                                },function(){
                                   if(fr==1)
                                        location.href="{:url('Workflowdb/index')}"
                                    else{
                                    	if(type_id==2)
                                        	location.href="{:url('TiApply/index')}"
                                        else
                                        	;
                                    }
                                  //parent.layer.close(parent.layer.getFrameIndex(window.name))
                                  //
                                });

                          }else{
                            swal({
                            title: "错误",
                            text:  res1["msg"],
                            type: "warning"
                            });
                          } 
          }
        });
}
</script>
</html>